#include "org_foundation_jala_softzip_SoftZip.h"
#include "stdio.h"
/*
 * Class:     org_foundation_jala_softzip_SoftZip
 * Method:    compress
 * Signature: (Ljava/lang/String;Ljava/lang/String;I)I
 */
JNIEXPORT jint JNICALL Java_org_foundation_jala_softzip_SoftZip_compress
  (JNIEnv * env, jobject obj, jstring source, jstring dest, jint compressionMethod)
{
  const char * sourceString = env->GetStringUTFChars(source, 0);
  const char * destString = env->GetStringUTFChars(dest, 0);
    
  compress(sourceString,destString,0);
  env->ReleaseStringUTFChars(source, sourceString);  
  env->ReleaseStringUTFChars(dest, destString);  
    
  printf("%s\n", __PRETTY_FUNCTION__);
}

/*
 * Class:     org_foundation_jala_softzip_SoftZip
 * Method:    decompress
 * Signature: (Ljava/lang/String;Ljava/lang/String;)I
 */
JNIEXPORT jint JNICALL Java_org_foundation_jala_softzip_SoftZip_decompress
  (JNIEnv * env, jobject obj, jstring source, jstring dest)
{
  const char * sourceString = env->GetStringUTFChars(source, 0);
  const char * destString = env->GetStringUTFChars(dest, 0);
  printf("Decompress::%s \n %s \n",sourceString,destString);  
  decompress(sourceString,destString);
  env->ReleaseStringUTFChars(source, sourceString);  
  env->ReleaseStringUTFChars(dest, destString);  
  printf("%s\n", __PRETTY_FUNCTION__);
}

/*
 * Class:     org_foundation_jala_softzip_SoftZip
 * Method:    checkIntegrity
 * Signature: (Ljava/lang/String;)Z
 */
JNIEXPORT jboolean JNICALL Java_org_foundation_jala_softzip_SoftZip_checkIntegrity
  (JNIEnv * env, jobject obj, jstring source)
{
  const char * sourceString = env->GetStringUTFChars(source, 0);
  
  checkIntegrity(sourceString);
  env->ReleaseStringUTFChars(source, sourceString);  

  printf("%s\n", __PRETTY_FUNCTION__);
}

